<template>
	<view class="bg-white u-padding-20">
		<u-navbar :autoBack="true" safeAreaInsetTop fixed placeholder title="点名记录" />
		<view>
			<u-cell-group v-for="(item,index) in list" :key="index" >
				<u-cell center :is-link="false" index="index"
					:title-style="{'width': '100%'}" :arrow="false">
					<view slot="title" class="line-height-view">{{item.studentName}} {{item.lessonRespVO.title}}</view>
					<view slot="label" class="line-height-view" style="font-size: 90%;">{{item.signTime ? parseTime(item.signTime, 'yyyy年MM月dd日 hh:mm:ss') : 
																	'上课时间：' + parseTime(item.lessonRespVO.date,'yyyy年MM月dd日')}} 
																	{{item.lessonRespVO.startTime}}至{{item.lessonRespVO.endTime}}</view>
					<view slot="value">{{item.signStateValue}}</view>
				</u-cell>
			</u-cell-group>
			<view class="u-padding-30 bg-white" v-if="list.length == 0" >
				<u-empty mode="list" text="暂无记录"></u-empty>
			</view>
		</view>
	</view>
</template>
<script>
	import paginateMix from "@/mixins/paginateMixins.js"
	import request from '@/utils/request'
	import { parseTime } from '@/utils/zhanpeng.js'
	export default {
		mixins: [paginateMix],
		data() {
			return {
				checked: false,
				list: [],
			}
		},
		onLoad() {
			this.handleReq()
		},
		methods: {
			parseTime(time) {
			  return parseTime(time,'{y}-{m}-{d}')
			},
			handleReq() {
				request({url:'/edu/lesson-student/rollCallRecord',data:{page: this.pageData.page}}).then(res => {
					if(!this.$common.handleResponseMsg(res)) return;
					this.list = this.list.concat(res.data.list)
					this.pageData.page = parseInt(res.page);
					this.pageData.lastPage = parseInt(res.pageCount);
				});
			},
			clickRight() {
				this.list = [];
				this.pageData.page = 1
				this.handleReq()
			},
			clickLeft() {
				uni.switchTab({
					url: '/pages/index/index'
				});
			}
		}
	}
</script>
<style lang="scss" scoped>
	.line-height-view {
		line-height: 220%;
		height: 220%;
	}
</style>
